from synapses import *
from math import exp

class CLayer(object):
    
    def __init__(self):
        self.values = []
        self.gradient = []
        self.v = []
        self.inputs = []
        
    def propagate(self, synapsis):
        if len(self.values) > 0:
            self.values = []
        for column in range(0, len(synapsis.matrix[0])):
            sum = 0.0
            indexInput = 0
            for row in range(0,  len(synapsis.matrix)):
                sum += self.inputs[indexInput]*synapsis.matrix[row][column]
                indexInput += 1
            self.values.append(float(1)/(1 + exp(-sum)))
        #print self.values
    
    def ground(self):
        pass
    
   
    
